class AddTestData < ActiveRecord::Migration
  
  def self.up
    User.delete_all
    User.create(:name => 'shawn')
    User.create(:name => 'duffer')
    User.create(:name => 'xiaopang')
    
    Talk.delete_all
    Talk.create(:topic => 'Pragmatic Version Control' ,
    :body =>
%{
This book is a recipe-based approach to using Subversion that will
get you up and running quickly---and correctly. All projects need
version control: it's a foundational piece of any project' s
infrastructure. Yet half of all project teams in the U.S. don't use
any version control at all. Many others don't use it well, and end
up experiencing time-consuming problems.
},
    :created_by => 1)
    Talk.create(:topic => 'Completing the Views' ,
    :body =>
%{
Ok, looks good, but that’s not how a Blog should behave! 
The Post’s show view should already have the Comments listing 
and New Comment Form as well! So let’s make some small adaptations. 
There’s nothing new here, just traditional Rails. 
},
    :created_by => 2)
    Talk.create(:topic => 'Aptana RadRails introduction' ,
    :body =>
%{
Aptana RadRails provides a rich and powerful user interface for 
creating Ruby on Rails applications. You can create projects, 
edit them with ease, and debug them with a variety of tools. 
RadRails ships with an embedded jRuby interpreter ready to go, 
or you can configure it to use an external Rails installation. 
},
    :created_by => 3)
    
    UserTalk.delete_all
    UserTalk.create(:user_id => 1, :talk_id => 1)
    UserTalk.create(:user_id => 1, :talk_id => 2)
    UserTalk.create(:user_id => 2, :talk_id => 2)
    UserTalk.create(:user_id => 2, :talk_id => 3)
    UserTalk.create(:user_id => 3, :talk_id => 3)
    UserTalk.create(:user_id => 3, :talk_id => 1)
  end
  
  
  def self.down
    User.delete_all
    Talk.delete_all
    UserTalk.delete_all
  end
end